import { defineConfig } from "vite";
import monkey, { util } from "vite-plugin-monkey";
import AutoImport from "unplugin-auto-import/vite";

const match = [
  "*://*a8ys.*/*",
  "*://dm84.tv/*",
  "*://msousou.*",
  "*://cddys*.*/*",
  "*://*wyjc*.*/*",
  "*://dpyy.xyz/*",
  "*://*.taiee.*/*",
  "*://kimani.tv/*",
  "*://*ppdys*.*/*",
  "*://*kuang*.*/*",
  "*://acgnya.com/*",
  "*://animoe.org/*",
  "*://*.ysgc.top/*",
  "*://*.*ncat*.*/*",
  "*://tinaacg.net/*",
  "*://www.aowu.tv/*",
  "*://damkvq.wiki/*",
  "*://xl01.com.de/*",
  "*://tv.gew.fund/*",
  "*://*.*bttwo*.*/*",
  "*://电影先生.com/*",
  "*://*.*freeok*.*/*",
  "*://*.*nyafun*.*/*",
  "*://*.*anfuns*.*/*",
  "*://*.*omofun*.*/*",
  "*://www.qifun.cc/*",
  "*://www.aafun.cc/*",
  "*://www.cyfz.vip/*",
  "*://dm1.xfdm.pro/*",
  "*://www.jqqzx.me/*",
  "*://www.dushe*.*/*",
  "*://www.zxzja.com/*",
  "*://www.libvio*.*/*",
  "*://*dytt8899.com/*",
  "*://*.*yinghua*.*/*",
  "*://www.gugu3.com/*",
  "*://www.jzacg.com/*",
  "*://www.mcydh.com/*",
  "*://www.agedm.org/*",
  "*://*.*fantuan*.*/*",
  "*://www.xxjio.com/*",
  "*://www.damiys.cc/*",
  "*://www.hhkan*.com/*",
  "*://www.czzy77.com/*",
  "*://www.aiwaiju.cc/*",
  "*://www.agefans.la/*",
  "*://www.mervod.com/*",
  "*://dick.xfani.com/*",
  "*://www.dushe9.app/*",
  "*://www.mutean.com/*",
  "*://www.fsdm02.com/*",
  "*://www.mgnacg.com/*",
  "*://www.acfuns.net/*",
  "*://www.acgpty.com/*",
  "*://dick.xfani.com/*",
  "*://www.clicli.pro/*",
  "*://www.voflix.fun/*",
  "*://www.dushe9.app/*",
  "*://www.kankanwu.cc/*",
  "*://www.akianime.cc/*",
  "*://www.huazidm.com/*",
  "*://www.freehd1.vip/*",
  "*://www.xiaohys.com/*",
  "*://www.nezhamv.com/*",
  "*://www.quickvod.cc/*",
  "*://www.dandantu.cc/*",
  "*://*.*netflixgc*.*/*",
  "*://www.bestpipe.cn/*",
  "*://www.dandanju.tv/*",
  "*://www.acgndog.com/*",
  "*://www.guowaiju.com/*",
  "*://www.laodifang.tv/*",
  "*://pzoap.moedot.net/*",
  "*://www.czzymovie.com/*",
  "*://*zhuiyingmao*.com/*",
  "*://anich.emmmm.eu.org/*",
  "*://www.klyingshi*.com/*",
  "*://xn--44qz85a01qpc.com/*",
  "*://anime.girigirilove.*/*",
];

// https://vitejs.dev/config/
export default defineConfig({
  build: {
    target: "es2020",
  },
  plugins: [
    AutoImport({
      imports: [util.unimportPreset],
    }),
    monkey({
      entry: "src/main.js",
      userscript: {
        match,
        author: "Feny",
        license: "MIT",
        version: "0.6.0",
        "run-at": "document-body",
        name: "关闭影视动漫网站的公告弹窗",
        namespace: "Violentmonkey Scripts",
        homepage: "https://github.com/xFeny/UserScript/tree/main/monkey-website-popup",
        description:
          "自动关闭动漫网站的公告弹窗，支持的站点有：anfuns、次元方舟、Animoe动漫、漫次元、MuteFun、girigiri爱动漫、咕咕番、AcFuns、NyaFun、橘子动漫、acgNya等",
        icon: "",
        require: ["https://unpkg.com/js-cookie@3.0.5/dist/js.cookie.min.js"],
        $extra: [["noframes", [""]]],
      },
    }),
  ],
});
